package com.pengzy.auth.controller;

import com.pengzy.auth.dto.LoginBo;
import com.pengzy.auth.dto.RegisterBo;
import com.pengzy.auth.services.RegisterService;
import com.pengzy.comment.core.annotation.ApiLog;
import com.pengzy.comment.core.enums.OperateEnum;
import com.pengzy.comment.web.result.JsonResult;
import com.pengzy.supports.dto.LoginUserDetails;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

/**
 * @author xiaozhi 2023/8/4
 */
@RestController
@RequestMapping("/core")
@Api(tags = "注册")
@Slf4j(topic = "api-log")
public class RegisterController {

    @Resource
    private RegisterService registerService;


    @RequestMapping(value = "/register",method = RequestMethod.POST)
    @ApiOperation(value = "注册")
    @ApiLog(method = "注册",type= OperateEnum.REGISTER)
    public JsonResult<Void> register(@Validated @RequestBody RegisterBo bo){
        return registerService.register(bo);
    }
}
